﻿using System;
using System.Configuration;
using System.Web;
/// <summary>
/// GetConfigContent获取Access数据库文件的路径
/// </summary>
public static class GetConfigContent
{
	static GetConfigContent()
	{
        connectionStringArticle = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
            HttpContext.Current.Server.MapPath("~/App_Data/ClassicArticle.mdb");
        connectionStringForum = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
            HttpContext.Current.Server.MapPath("~/App_Data/Ambmh_Forum_v1.mdb");
        connectionStringNews = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
            HttpContext.Current.Server.MapPath("~/App_Data/rss.mdb");
        showRecommendCount = int.Parse(ConfigurationManager.AppSettings["ShowRecommendCount"]);
        articlePageTotalCount = int.Parse(ConfigurationManager.AppSettings["ArticlePageTotalCount"]);
        articleBlockCount = int.Parse(ConfigurationManager.AppSettings["ArticleBlockCount"]);
        memorialPageShowCount = int.Parse(ConfigurationManager.AppSettings["MemorialPageShowCount"]);
        goodluckPageShowCount = int.Parse(ConfigurationManager.AppSettings["GoodluckPageShowCount"]);
	}
    /// <summary>
    /// 文章数据库路径
    /// </summary>
    public static string ConnectionStringArticle
    {
        get
        {
            return connectionStringArticle;
        }
    }
    /// <summary>
    /// 论坛数据库路径
    /// </summary>
    public static string ConnectionStringForum
    {
        get
        {
            return connectionStringForum;
        }
    }/// <summary>
    /// 新闻数据库路径
    /// </summary>
    public static string ConnectionStringNews
    {
        get
        {
            return connectionStringNews;
        }
    }
    /// <summary>
    /// 在首页每个分类栏目中显示的文章数目
    /// </summary>
    public static int ShowRecommendCount
    {
        get
        {
            return showRecommendCount;
        }
    }
    /// <summary>
    /// 文章分类列表页面总共显示的文章数
    /// </summary>
    public static int ArticlePageTotalCount
    {
        get
        {
            return articlePageTotalCount;
        }
    }
    /// <summary>
    /// 文章分类列表页面中，每个块显示的文章标题数
    /// </summary>
    public static int ArticleBlockCount
    {
        get
        {
            return articleBlockCount;
        }
    }
    public static int MemorialPageShowCount
    {
        get
        {
            return memorialPageShowCount;
        }
    }
    public static int GoodluckPageShowCount
    {
        get
        {
            return goodluckPageShowCount;
        }
    }
    private static string connectionStringForum;//论坛连接字符串
    private readonly static string connectionStringArticle;//文章连接字符串
    private static string connectionStringNews;//新闻连接字符串
    private static int showRecommendCount;//在首页每个分类栏目中显示的文章数
    private static int articlePageTotalCount;//文章分类列表页面总共显示的文章数
    private static int articleBlockCount;//文章分类列表页面中，每个块显示的文章标题数
    private static int memorialPageShowCount;//纪念碑网页上，每页显示的纪念碑数
    private static int goodluckPageShowCount;//许愿页面，每页显示的愿望数
}
